<?php
$this->breadcrumbs=array(
	'Manage Members'=>array('admin'),
	$model->first_name . " " .$model->last_name,
);

$this->menu=array(
	array('label'=>'Update Members', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Members', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Referrals', 'url'=>array('ReferralsMembers/admin', 'id'=>$model->id)),
	array('label'=>'Transaction History', 'url'=>array('TransactionMembers/admin', 'id'=>$model->id)),
	array('label'=>'Manage Members', 'url'=>array('admin')),
);
?>

<h1>View Members</h1>
<?php
if (!isset($model->referrer_id)) {
	$this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'first_name',
		'last_name',
		'email',
		'address',
		'phone',
		'nric',
		'referrer_id',
		'post_code',
		'refer_code',
		'is_member:boolean',
		array(
			'name'=>'titleCode',
			'value'=>$model->titleCode->name,
			),
		'status:boolean',
		'balance',
		'created_date',
	),
)); 
} else {
	 $this->widget('zii.widgets.CDetailView', array(
		'data'=>$model,
		'attributes'=>array(
			'first_name',
			'last_name',
			'email',
			'address',
			'phone',
			'nric',
			array(
				'name'=>'referrer',
				'type'=>'html',
				'value'=>CHtml::link($model->referrer->first_name . " " . $model->referrer->last_name, $model->referrer->id, array('target' => '_blank')),
			),
			'post_code',
			'refer_code',
			'is_member:boolean',
			array(
			'name'=>'titleCode',
			'value'=>$model->titleCode->name,
			),
			'status:boolean',
			'balance',
			'created_date',
		),
	)); 
}
?>
